POV-Ray : Newsgroups : povray.off-topic : Trying to code an "offset rotation" for SL. : Re: Trying to code an "offset rotation" for SL. Server Time
7 Sep 2024 07:20:50 EDT (-0400)
  Re: Trying to code an "offset rotation" for SL.  
From: scott
Date: 16 Jul 2008 02:51:38
Message: <487d9a7a@news.povray.org>
> This however, rotating on the
> Y axis, goes nuts:

If you're rotating only the y axis (ie Rot.x and Rot.z are zero), then the y 
coordinate shouldn't change.

>        y2 = llCos(Rot.x* DEG_TO_RAD)*y - llSin(Rot.x* DEG_TO_RAD)*z;

Since Rot.x is zero, the above line is equivalent to y2 = y

>        y = y2;

Obvious.

>        y2 = llSin(Rot.z* DEG_TO_RAD)*x + llCos(Rot.z* DEG_TO_RAD)*y;

Again, since Rot.z should be zero here, this line is again equivalent to y2 
= y

> [22:41]  Object: <1.00000, 1.00000, 1.00000>
> [22:41]  Object: <0.99969, 1.01760, 1.00000>

I would suggest you check the values of Rot.x and Rot.z in your code, and 
also the xyz coords after each rotation - none of them should modify the y 
coordinate if only Rot.y is non-zero.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.